<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/css/jquery-select/jquery.searchableSelect.css" rel="stylesheet" type="text/css">
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="fixed-table-toolbar">
                    <input id="type" type="hidden" class="form-control" name="type" th:value="${type}">
                    <div class="columns pull-right" role="group">
                        <button class="btn btn-success" onclick="reLoad()">
                            <i class="fa fa-search" aria-hidden="true"></i>查询
                        </button>
                        <button class="btn btn-success" onclick="refreshZhiboInfo()">
                            <i class="fa fa-search" aria-hidden="true"></i>手动刷新
                        </button>
                        <!--<button class="btn btn-danger" shiro:hasPermission="member:manage:export" onclick="exportMembers()">-->
                        <!--<i class="fa fa-mail-reply-all" aria-hidden="true"></i>导出-->
                        <!--</button>-->
                    </div>
                    <div class="columns pull-left col-md-1 nopadding">
                        <select id="liveStatus" name="liveStatus" data-placeholder="选择直播间状态"
                                class="form-control chosen-select" tabindex="2">
                            <option value="" selected="selected">直播间状态</option>
                            <option value="101">直播中</option>
                            <option value="102">未开始</option>
                            <option value="103">已结束</option>
                            <option value="104">禁播</option>
                            <option value="105">暂停中</option>
                            <option value="106">异常</option>
                            <option value="107">已过期</option>
                        </select>
                    </div>
                    <div class="pull-left search nopadding" style="size: 30%">
                        <input type="text" class="laydate-icon form-control" placeholder="直播开始时间"
                               id="startDate" name="startDate"
                               onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
                               style="background-color: #fff;" readonly="readonly" th:value="${startDate}"/>
                    </div>
                    <div class="pull-left search nopadding" style="size: 30%">
                        <input type="text" class="laydate-icon form-control" placeholder="直播结束时间"
                               id="endDate" name="endDate"
                               onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
                               style="background-color: #fff;" readonly="readonly" th:value="${endDate}"/>
                    </div>
                    <div class="pull-left search nopadding" style="size: 30%">
                        <input id="keyword" name="keyword" type="text" class="form-control" placeholder="直播间名字">
                    </div>
                    <div class="columns pull-left col-md-1 nopadding" th:if="${flag} == '0'">
                        <select data-placeholder="商户" class="form-control chosen-select" id="centreId" tabindex="2">
                            <option value="" selected="selected">选择商户</option>
                            <option th:each="item: ${centreList}" th:text="${item.name}"
                                    th:value="${item.centreId}"></option>
                        </select>
                    </div>
                </div>
                <table id="membersTable" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>

    <div>
        <script type="text/javascript">
            var s_edit_h = 'hidden';
            var s_hmd_h = 'hidden';
            var s_detail_h = 'hidden';
            var s_anchors_h = 'hidden';
            var s_useragent_h = 'hidden';
        </script>
    </div>
    <div shiro:hasPermission="member:manage:edit">
        <script type="text/javascript">
            s_edit_h = '';
        </script>
    </div>
    <div shiro:hasPermission="member:manage:setCommander">
        <script type="text/javascript">
            s_detail_h = '';
        </script>
    </div>
    <div shiro:hasPermission="member:manage:hmd">
        <script type="text/javascript">
            var s_hmd_h = '';
        </script>
    </div>
    <div shiro:hasPermission="zhibo:manage:rooms:update">
        <script type="text/javascript">
            var s_anchors_h = '';
        </script>
    </div>
    <div shiro:hasPermission="member:manage:edit">
        <script type="text/javascript">
            var s_useragent_h = '';
        </script>
    </div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript" src="/js/appjs/zhibo/manage/rooms.js"></script>
<script src="/js/jquery-select/jquery.searchableSelect.js"></script>
<script type="text/javascript">
    $(function () {
        $('select').searchableSelect();


        /**
         * 设置会员信息
         *
         * @param memberId
         * @param memberName
         */
        function loadMemberInfo(memberId, relateId) {
            $.ajax({
                url: "/zhiboroom/manage/updateAnchor",
                data: {"roomId": relateId, "auchorId": memberId},
                dataType: "json",
                method:'POST',
                success: function (data) {
                    reLoad();
                }
            })
        }
    });
</script>
</body>
</html>